package org.apcs.pokemon.io.net;

/**
 * Author:          Zachary Reed
 * Date Created:    Mar 28, 2010
 * Last Modified:   Mar 28, 2010
 * Package:         org.apcs.pokemon.io.net
 * Filename:        Player.java
 * Description:     A class to hold data about players connected over the network
 *
 */

import java.net.InetAddress;

public class Player {

    String strName = "";
    int intStatus = 2;
    int intPort = 0;
    InetAddress netAddress = null;

    /**
     * Construct a new Player, which holds data about a player on the network.
     *
     * @param name Name of the player
     * @param status Status of the player
     * @param netinfo IP address and port used to communicate with player
     */
    public Player(String name,int status,InetAddress addr,int port) {
        strName = name;
        intStatus = status;
        netAddress = addr;
        intPort = port;
    }

    /**
     * Get the name of the player.
     *
     * @return The name of the player.
     */
    public String getName() {return strName;}

    /**
     * Get the status of the player.
     *
     * Statuses(?):
     *      0   =   In battle (unavailable)
     *      1   =   Wants to battle (available)
     *      2   =   Doesn't want to battle (unavailabe)
     *
     * @return The status of the player.
     */
    public int getStatus() {return intStatus;}

    /**
     * Get the IP address used to communicate with the player as an InetAddress object.
     *
     * @return The IP address of the player.
     */
    public InetAddress getAddress() {return netAddress;}

    /**
     * Get the port number (both TCP & UDP) used to communicate with the player.
     *
     * @return The port used to communicate with the player.
     */
    public int getPort() {return intPort;}

    public void setStatus(int status) {intStatus = status;}
}
